{% extends '@SyliusShop/layout.html.twig' %}

{% block content %}
    <div class="ui hidden divider"></div>
    <div class="ui grid">
        <div class="center aligned sixteen wide column">
            <h1 class="ui icon header">
                {% set lastPayment = order.payments.last() %}
                <i class="circular rocket icon"></i>
                <div class="content" id="sylius-thank-you">
                    {{ 'sylius.ui.thank_you'|trans }}
                    <div class="sub header">{{ 'sylius.ui.placed_an_order'|trans }}</div>
                </div>
            </h1>

            {{ sonata_block_render_event('sylius.shop.order.thank_you.after_message', {'order': order}) }}

            {% if lastPayment != false %}
                {%  if lastPayment.method.instructions is not null %}
                    <div id="sylius-payment-method-instructions" class="ui segment">
                        {{ lastPayment.method.instructions }}
                    </div>
                {% endif %}
                <div class="ui hidden divider"></div>
                <a href="{{ path('sylius_shop_order_show', {'tokenValue': order.tokenValue}) }}" id="sylius-show-order" class="ui large blue button">{{ 'sylius.ui.view_your_order_or_change_payment_method'|trans }}</a>
            {% endif %}
        </div>
    </div>
{% endblock %}
